package com.zb.service.impl;

import com.zb.service.ZjNetworkInviteCodeSendLogService;
import com.zb.service.ZjSmsSendLogService;
import com.zb.vo.NetworkInviteCodeSendLogVo;
import com.zb.vo.SmsSendLogVo;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author WEN
 * @Date 2024/3/23 0023
 **/
@Service
public class SmsLogService {
    private static SmsLogService smsLogService;
    @PostConstruct
    public void init() {
        smsLogService = this;
    }
    @Resource
    private ZjSmsSendLogService smsSendLogService;
    @Resource
    private ZjNetworkInviteCodeSendLogService networkInviteCodeSendLogService;

    /**
     * 保存发送成功的短信记录
     * @param logVo
     */
    public static void saveSuccess(SmsSendLogVo logVo) {
        List<SmsSendLogVo> logVos = new ArrayList<>();
        logVos.add(logVo);
        smsLogService.smsSendLogService.saveSuccess(logVos);
    }

    /**
     * 保存发送成功的短信记录
     * @param logVos
     */
    public static void saveSuccess(List<SmsSendLogVo> logVos) {
        smsLogService.smsSendLogService.saveSuccess(logVos);
    }

    /**
     * 保存发送失败的短信记录
     * @param logVo
     */
    public static void saveFailt(SmsSendLogVo logVo) {
        List<SmsSendLogVo> logVos = new ArrayList<>();
        logVos.add(logVo);
        smsLogService.smsSendLogService.saveFailt(logVos);
    }

    /**
     * 保存发送失败的短信记录
     * @param logVos
     */
    public static void saveFailt(List<SmsSendLogVo> logVos) {
        smsLogService.smsSendLogService.saveFailt(logVos);
    }

    /**
     * 短信邀请码发送成功记录
     * @param inviteCodeSendLogVo
     */
    public static void saveInviteCodeSuccess(NetworkInviteCodeSendLogVo inviteCodeSendLogVo) {
        List<NetworkInviteCodeSendLogVo> inviteCodeSendLogVos = new ArrayList<>();
        inviteCodeSendLogVos.add(inviteCodeSendLogVo);
        smsLogService.networkInviteCodeSendLogService.saveSuccess(inviteCodeSendLogVos);
    }

    /**
     * 短信邀请码发送成功记录
     * @param inviteCodeSendLogVos
     */
    public static void saveInviteCodeSuccess(List<NetworkInviteCodeSendLogVo> inviteCodeSendLogVos) {
        smsLogService.networkInviteCodeSendLogService.saveSuccess(inviteCodeSendLogVos);
    }

    /**
     * 短信邀请码发送失败记录
     * @param inviteCodeSendLogVo
     */
    public static void saveInviteCodeFailt(NetworkInviteCodeSendLogVo inviteCodeSendLogVo) {
        List<NetworkInviteCodeSendLogVo> inviteCodeSendLogVos = new ArrayList<>();
        inviteCodeSendLogVos.add(inviteCodeSendLogVo);
        saveInviteCodeFailt(inviteCodeSendLogVos);
    }
    /**
     * 短信邀请码发送失败记录
     * @param inviteCodeSendLogVos
     */
    public static void saveInviteCodeFailt(List<NetworkInviteCodeSendLogVo> inviteCodeSendLogVos) {
        smsLogService.networkInviteCodeSendLogService.saveFailt(inviteCodeSendLogVos);
    }



}
